Object.defineProperty(exports, "__esModule", { value: !0 }),
  (exports.userCancelAccount =
    exports.subscribeExhibition =
    exports.saveOrCancelCollection =
    exports.postPointsSearch =
    exports.postPointsOutdoor =
    exports.postPointsDetail =
    exports.postMuseumInfo =
    exports.postLineList =
    exports.postLineDetail =
    exports.postHistoryList =
    exports.postExhibitionSearch =
    exports.postExhibitSearch =
    exports.postExhibitInfo =
    exports.postCreateComplain =
    exports.postCreateAdvice =
    exports.postComplaintList =
    exports.postComplaintInfo =
    exports.postAdviceList =
    exports.postAdviceInfo =
    exports.myCollectionList =
    exports.getPositionInfo =
    exports.getOpenInfo =
    exports.getMainstayList =
    exports.getMainstayInfo =
    exports.getLbsProxy =
    exports.getIndoorList =
    exports.getHistoryList =
    exports.getCollectionList =
    exports.getCheckList =
    exports.exhibitionInfo =
    exports.clearHistoryList =
    exports.checkListRemote =
    exports.PosCardCheck =
      void 0);
var t = require("../../@babel/runtime/helpers/toConsumableArray"),
  r = o(require("../../@babel/runtime/regenerator")),
  e = require("../../@babel/runtime/helpers/asyncToGenerator"),
  n = o(require("@libs/lodash")),
  a = o(require("../request")),
  s = o(require("@config/index")),
  u = require("../checkList");
function o(t) {
  return t && t.__esModule ? t : { default: t };
}
var c = new a.default(),
  i = s.default.isProd ? s.default.API_PROD : s.default.API_TEST,
  p =
    ((exports.postMuseumInfo = (function () {
      var t = e(
        r.default.mark(function t() {
          var e, n;
          return r.default.wrap(function (t) {
            for (;;)
              switch ((t.prev = t.next)) {
                case 0:
                  return (
                    (e = "".concat(i, "/san/v1/museum/info")),
                    (t.next = 3),
                    c.post(e, {}, {})
                  );
                case 3:
                  return (n = t.sent), t.abrupt("return", n);
                case 5:
                case "end":
                  return t.stop();
              }
          }, t);
        }),
      );
      return function () {
        return t.apply(this, arguments);
      };
    })()),
    (exports.postExhibitSearch = (function () {
      var t = e(
        r.default.mark(function t(e) {
          var n, a;
          return r.default.wrap(function (t) {
            for (;;)
              switch ((t.prev = t.next)) {
                case 0:
                  return (
                    (n = "".concat(i, "/san/v1/exhibit/search")),
                    (t.next = 3),
                    c.post(n, e, {})
                  );
                case 3:
                  return (a = t.sent), t.abrupt("return", a);
                case 5:
                case "end":
                  return t.stop();
              }
          }, t);
        }),
      );
      return function (r) {
        return t.apply(this, arguments);
      };
    })()),
    (exports.postExhibitInfo = (function () {
      var t = e(
        r.default.mark(function t(e) {
          var n, a;
          return r.default.wrap(function (t) {
            for (;;)
              switch ((t.prev = t.next)) {
                case 0:
                  return (
                    (n = "".concat(i, "/san/v1/exhibit/info")),
                    (t.next = 3),
                    c.post(n, e, {})
                  );
                case 3:
                  return (a = t.sent), t.abrupt("return", a);
                case 5:
                case "end":
                  return t.stop();
              }
          }, t);
        }),
      );
      return function (r) {
        return t.apply(this, arguments);
      };
    })())),
  f =
    ((exports.postExhibitionSearch = (function () {
      var t = e(
        r.default.mark(function t(e) {
          var n, a;
          return r.default.wrap(function (t) {
            for (;;)
              switch ((t.prev = t.next)) {
                case 0:
                  return (
                    (n = "".concat(i, "/san/v1/exhibition/search")),
                    (t.next = 3),
                    c.post(n, e, {})
                  );
                case 3:
                  return (a = t.sent), t.abrupt("return", a);
                case 5:
                case "end":
                  return t.stop();
              }
          }, t);
        }),
      );
      return function (r) {
        return t.apply(this, arguments);
      };
    })()),
    (exports.postHistoryList = function () {
      var t =
        arguments.length > 0 && void 0 !== arguments[0]
          ? arguments[0]
          : { name: "" };
      return new Promise(function (r) {
        var e = wx.getStorageSync("historyList") || [];
        (e = e.filter(function (r) {
          return t.name && t.name !== r.name;
        })).unshift(t),
          wx.setStorageSync("historyList", e),
          r(e);
      });
    }),
    (exports.getHistoryList = function () {
      return new Promise(function (t) {
        t(wx.getStorageSync("historyList"));
      });
    }),
    (exports.postCreateComplain = (function () {
      var t = e(
        r.default.mark(function t(e) {
          var n, a;
          return r.default.wrap(function (t) {
            for (;;)
              switch ((t.prev = t.next)) {
                case 0:
                  return (
                    (n = "".concat(i, "/san/v1/complaint/add")),
                    (t.next = 3),
                    c.post(n, e, {})
                  );
                case 3:
                  return (a = t.sent), t.abrupt("return", a);
                case 5:
                case "end":
                  return t.stop();
              }
          }, t);
        }),
      );
      return function (r) {
        return t.apply(this, arguments);
      };
    })()),
    (exports.clearHistoryList = function () {
      return new Promise(function (t) {
        wx.setStorageSync("historyList", []), t([]);
      });
    }),
    (exports.getOpenInfo = (function () {
      var t = e(
        r.default.mark(function t() {
          var e, n;
          return r.default.wrap(function (t) {
            for (;;)
              switch ((t.prev = t.next)) {
                case 0:
                  return (
                    (e = "".concat(i, "/san/v1/opening/info")),
                    (t.next = 3),
                    c.post(e, {}, {})
                  );
                case 3:
                  return (n = t.sent), t.abrupt("return", n);
                case 5:
                case "end":
                  return t.stop();
              }
          }, t);
        }),
      );
      return function () {
        return t.apply(this, arguments);
      };
    })()),
    (exports.postComplaintList = (function () {
      var t = e(
        r.default.mark(function t(e) {
          var n, a;
          return r.default.wrap(function (t) {
            for (;;)
              switch ((t.prev = t.next)) {
                case 0:
                  return (
                    (n = "".concat(i, "/san/v1/complaint/list")),
                    (t.next = 3),
                    c.post(n, e, {})
                  );
                case 3:
                  return (a = t.sent), t.abrupt("return", a);
                case 5:
                case "end":
                  return t.stop();
              }
          }, t);
        }),
      );
      return function (r) {
        return t.apply(this, arguments);
      };
    })()),
    (exports.postComplaintInfo = (function () {
      var t = e(
        r.default.mark(function t(e) {
          var n, a;
          return r.default.wrap(function (t) {
            for (;;)
              switch ((t.prev = t.next)) {
                case 0:
                  return (
                    (n = "".concat(i, "/san/v1/complaint/info")),
                    (t.next = 3),
                    c.post(n, e, {})
                  );
                case 3:
                  return (a = t.sent), t.abrupt("return", a);
                case 5:
                case "end":
                  return t.stop();
              }
          }, t);
        }),
      );
      return function (r) {
        return t.apply(this, arguments);
      };
    })()),
    (exports.postCreateAdvice = (function () {
      var t = e(
        r.default.mark(function t(e) {
          var n, a;
          return r.default.wrap(function (t) {
            for (;;)
              switch ((t.prev = t.next)) {
                case 0:
                  return (
                    (n = "".concat(i, "/san/v1/recommend/add")),
                    (t.next = 3),
                    c.post(n, e, {})
                  );
                case 3:
                  return (a = t.sent), t.abrupt("return", a);
                case 5:
                case "end":
                  return t.stop();
              }
          }, t);
        }),
      );
      return function (r) {
        return t.apply(this, arguments);
      };
    })()),
    (exports.postAdviceList = (function () {
      var t = e(
        r.default.mark(function t(e) {
          var n, a;
          return r.default.wrap(function (t) {
            for (;;)
              switch ((t.prev = t.next)) {
                case 0:
                  return (
                    (n = "".concat(i, "/san/v1/recommend/list")),
                    (t.next = 3),
                    c.post(n, e, {})
                  );
                case 3:
                  return (a = t.sent), t.abrupt("return", a);
                case 5:
                case "end":
                  return t.stop();
              }
          }, t);
        }),
      );
      return function (r) {
        return t.apply(this, arguments);
      };
    })()),
    (exports.postAdviceInfo = (function () {
      var t = e(
        r.default.mark(function t(e) {
          var n, a;
          return r.default.wrap(function (t) {
            for (;;)
              switch ((t.prev = t.next)) {
                case 0:
                  return (
                    (n = "".concat(i, "/san/v1/recommend/info")),
                    (t.next = 3),
                    c.post(n, e, {})
                  );
                case 3:
                  return (a = t.sent), t.abrupt("return", a);
                case 5:
                case "end":
                  return t.stop();
              }
          }, t);
        }),
      );
      return function (r) {
        return t.apply(this, arguments);
      };
    })()),
    (exports.postPointsSearch = (function () {
      var t = e(
        r.default.mark(function t(e) {
          var n, a;
          return r.default.wrap(function (t) {
            for (;;)
              switch ((t.prev = t.next)) {
                case 0:
                  return (
                    (n = "".concat(i, "/san/v1/poi/search")),
                    (t.next = 3),
                    c.post(n, e, {})
                  );
                case 3:
                  return (a = t.sent), t.abrupt("return", a);
                case 5:
                case "end":
                  return t.stop();
              }
          }, t);
        }),
      );
      return function (r) {
        return t.apply(this, arguments);
      };
    })()));
(exports.postPointsOutdoor = n.default.memoize(
  e(
    r.default.mark(function a() {
      var s, u, o, c;
      return r.default.wrap(function (a) {
        for (;;)
          switch ((a.prev = a.next)) {
            case 0:
              return (a.next = 2), f({ rn: 20, poi_type: 2 });
            case 2:
              if (
                ((u = a.sent), null !== (s = u.data) && void 0 !== s && s.list)
              ) {
                a.next = 5;
                break;
              }
              return a.abrupt("return", []);
            case 5:
              return (
                (o = Math.floor(u.data.total / 20)),
                (a.next = 8),
                Promise.all(
                  Array(o)
                    .fill("")
                    .map(
                      (function () {
                        var t = e(
                          r.default.mark(function t(e, n) {
                            return r.default.wrap(function (t) {
                              for (;;)
                                switch ((t.prev = t.next)) {
                                  case 0:
                                    return t.abrupt(
                                      "return",
                                      f({ pn: n + 2, rn: 20, poi_type: 2 }),
                                    );
                                  case 1:
                                  case "end":
                                    return t.stop();
                                }
                            }, t);
                          }),
                        );
                        return function (r, e) {
                          return t.apply(this, arguments);
                        };
                      })(),
                    ),
                )
              );
            case 8:
              return (
                (c = a.sent),
                a.abrupt(
                  "return",
                  n.default.flatten(
                    [u.data.list].concat(
                      t(
                        c.map(function (t) {
                          return t.data.list;
                        }),
                      ),
                    ),
                  ),
                )
              );
            case 10:
            case "end":
              return a.stop();
          }
      }, a);
    }),
  ),
)),
  (exports.postPointsDetail = (function () {
    var t = e(
      r.default.mark(function t(e) {
        var n, a;
        return r.default.wrap(function (t) {
          for (;;)
            switch ((t.prev = t.next)) {
              case 0:
                return (
                  (n = "".concat(i, "/san/v1/poi/info")),
                  (t.next = 3),
                  c.post(n, e, {})
                );
              case 3:
                return (a = t.sent), t.abrupt("return", a);
              case 5:
              case "end":
                return t.stop();
            }
        }, t);
      }),
    );
    return function (r) {
      return t.apply(this, arguments);
    };
  })()),
  (exports.checkListRemote = n.default.memoize(
    e(
      r.default.mark(function t() {
        return r.default.wrap(function (t) {
          for (;;)
            switch ((t.prev = t.next)) {
              case 0:
                return t.abrupt(
                  "return",
                  p({
                    exhibit_id: u.checkList.map(function (t) {
                      return t.mainstay_id;
                    }),
                  }),
                );
              case 1:
              case "end":
                return t.stop();
            }
        }, t);
      }),
    ),
  )),
  (exports.myCollectionList = (function () {
    var t = e(
      r.default.mark(function t(e) {
        var n, a;
        return r.default.wrap(function (t) {
          for (;;)
            switch ((t.prev = t.next)) {
              case 0:
                return (
                  (n = "".concat(i, "/san/v1/save/list")),
                  (t.next = 3),
                  c.post(n, e, {})
                );
              case 3:
                return (a = t.sent), t.abrupt("return", a);
              case 5:
              case "end":
                return t.stop();
            }
        }, t);
      }),
    );
    return function (r) {
      return t.apply(this, arguments);
    };
  })()),
  (exports.saveOrCancelCollection = (function () {
    var t = e(
      r.default.mark(function t(e) {
        var n, a;
        return r.default.wrap(function (t) {
          for (;;)
            switch ((t.prev = t.next)) {
              case 0:
                return (
                  (n = "".concat(i, "/san/v1/save")),
                  (t.next = 3),
                  c.post(n, e, {})
                );
              case 3:
                return (a = t.sent), t.abrupt("return", a);
              case 5:
              case "end":
                return t.stop();
            }
        }, t);
      }),
    );
    return function (r) {
      return t.apply(this, arguments);
    };
  })()),
  (exports.postLineList = (function () {
    var t = e(
      r.default.mark(function t(e) {
        var n, a;
        return r.default.wrap(function (t) {
          for (;;)
            switch ((t.prev = t.next)) {
              case 0:
                return (
                  (n = "".concat(i, "/san/v1/strategy/list")),
                  (t.next = 3),
                  c.post(n, e, {})
                );
              case 3:
                return (a = t.sent), t.abrupt("return", a);
              case 5:
              case "end":
                return t.stop();
            }
        }, t);
      }),
    );
    return function (r) {
      return t.apply(this, arguments);
    };
  })()),
  (exports.postLineDetail = (function () {
    var t = e(
      r.default.mark(function t(e) {
        var n, a;
        return r.default.wrap(function (t) {
          for (;;)
            switch ((t.prev = t.next)) {
              case 0:
                return (
                  (n = "".concat(i, "/san/v1/strategy/info")),
                  (t.next = 3),
                  c.post(n, e, {})
                );
              case 3:
                return (a = t.sent), t.abrupt("return", a);
              case 5:
              case "end":
                return t.stop();
            }
        }, t);
      }),
    );
    return function (r) {
      return t.apply(this, arguments);
    };
  })()),
  (exports.exhibitionInfo = (function () {
    var t = e(
      r.default.mark(function t(e) {
        var n, a;
        return r.default.wrap(function (t) {
          for (;;)
            switch ((t.prev = t.next)) {
              case 0:
                return (
                  (n = "".concat(i, "/san/v1/exhibition/info")),
                  (t.next = 3),
                  c.post(n, e, {})
                );
              case 3:
                return (a = t.sent), t.abrupt("return", a);
              case 5:
              case "end":
                return t.stop();
            }
        }, t);
      }),
    );
    return function (r) {
      return t.apply(this, arguments);
    };
  })()),
  (exports.getPositionInfo = (function () {
    var t = e(
      r.default.mark(function t(e) {
        var n, a;
        return r.default.wrap(function (t) {
          for (;;)
            switch ((t.prev = t.next)) {
              case 0:
                return (
                  (n = "".concat(i, "/san/v1/poi/info")),
                  (t.next = 3),
                  c.post(n, e, {})
                );
              case 3:
                return (a = t.sent), t.abrupt("return", a);
              case 5:
              case "end":
                return t.stop();
            }
        }, t);
      }),
    );
    return function (r) {
      return t.apply(this, arguments);
    };
  })()),
  (exports.getMainstayList = (function () {
    var t = e(
      r.default.mark(function t(e) {
        var n, a;
        return r.default.wrap(function (t) {
          for (;;)
            switch ((t.prev = t.next)) {
              case 0:
                return (
                  (n = "".concat(i, "/san/v1/mainstay/list")),
                  (t.next = 3),
                  c.post(n, e, {})
                );
              case 3:
                return (a = t.sent), t.abrupt("return", a);
              case 5:
              case "end":
                return t.stop();
            }
        }, t);
      }),
    );
    return function (r) {
      return t.apply(this, arguments);
    };
  })()),
  (exports.getMainstayInfo = (function () {
    var t = e(
      r.default.mark(function t(e) {
        var n, a;
        return r.default.wrap(function (t) {
          for (;;)
            switch ((t.prev = t.next)) {
              case 0:
                return (
                  (n = "".concat(i, "/san/v1/mainstay/info")),
                  (t.next = 3),
                  c.post(n, e, {})
                );
              case 3:
                return (a = t.sent), t.abrupt("return", a);
              case 5:
              case "end":
                return t.stop();
            }
        }, t);
      }),
    );
    return function (r) {
      return t.apply(this, arguments);
    };
  })()),
  (exports.getCheckList = (function () {
    var t = e(
      r.default.mark(function t(e) {
        var n, a;
        return r.default.wrap(function (t) {
          for (;;)
            switch ((t.prev = t.next)) {
              case 0:
                return (
                  (n = "".concat(i, "/san/v1/card/check/list")),
                  (t.next = 3),
                  c.post(n, e, {})
                );
              case 3:
                return (a = t.sent), t.abrupt("return", a);
              case 5:
              case "end":
                return t.stop();
            }
        }, t);
      }),
    );
    return function (r) {
      return t.apply(this, arguments);
    };
  })()),
  (exports.PosCardCheck = (function () {
    var t = e(
      r.default.mark(function t(e) {
        var n, a;
        return r.default.wrap(function (t) {
          for (;;)
            switch ((t.prev = t.next)) {
              case 0:
                return (
                  (n = "".concat(i, "/san/v1/card/check")),
                  (t.next = 3),
                  c.post(n, e, {})
                );
              case 3:
                return (a = t.sent), t.abrupt("return", a);
              case 5:
              case "end":
                return t.stop();
            }
        }, t);
      }),
    );
    return function (r) {
      return t.apply(this, arguments);
    };
  })()),
  (exports.subscribeExhibition = (function () {
    var t = e(
      r.default.mark(function t(e) {
        var n, a;
        return r.default.wrap(function (t) {
          for (;;)
            switch ((t.prev = t.next)) {
              case 0:
                return (
                  (n = "".concat(i, "/san/v1/exhibition/subscribe")),
                  (t.next = 3),
                  c.post(n, e, {})
                );
              case 3:
                return (a = t.sent), t.abrupt("return", a);
              case 5:
              case "end":
                return t.stop();
            }
        }, t);
      }),
    );
    return function (r) {
      return t.apply(this, arguments);
    };
  })()),
  (exports.getCollectionList = (function () {
    var t = e(
      r.default.mark(function t(e) {
        var n, a;
        return r.default.wrap(function (t) {
          for (;;)
            switch ((t.prev = t.next)) {
              case 0:
                return (
                  (n = "".concat(i, "/san/v1/exhibition/exhibit/list")),
                  (t.next = 3),
                  c.post(n, e, {})
                );
              case 3:
                return (a = t.sent), t.abrupt("return", a);
              case 5:
              case "end":
                return t.stop();
            }
        }, t);
      }),
    );
    return function (r) {
      return t.apply(this, arguments);
    };
  })()),
  (exports.getLbsProxy = (function () {
    var t = e(
      r.default.mark(function t(e) {
        var n, a;
        return r.default.wrap(function (t) {
          for (;;)
            switch ((t.prev = t.next)) {
              case 0:
                return (
                  (n = "".concat(i, "/san/v1/lbs/proxy")),
                  (t.next = 3),
                  c.post(n, e, {})
                );
              case 3:
                return (a = t.sent), t.abrupt("return", a);
              case 5:
              case "end":
                return t.stop();
            }
        }, t);
      }),
    );
    return function (r) {
      return t.apply(this, arguments);
    };
  })()),
  (exports.getIndoorList = (function () {
    var t = e(
      r.default.mark(function t(e) {
        var n, a, s;
        return r.default.wrap(function (t) {
          for (;;)
            switch ((t.prev = t.next)) {
              case 0:
                return (
                  (n = "".concat(i, "/san/v1/ar/information/info")),
                  (a = {}),
                  (t.next = 4),
                  c.post(n, e, {})
                );
              case 4:
                return (
                  (s = t.sent) && 0 === s.code && (a = s.data),
                  t.abrupt("return", a)
                );
              case 7:
              case "end":
                return t.stop();
            }
        }, t);
      }),
    );
    return function (r) {
      return t.apply(this, arguments);
    };
  })()),
  (exports.userCancelAccount = (function () {
    var t = e(
      r.default.mark(function t(e) {
        var n, a;
        return r.default.wrap(function (t) {
          for (;;)
            switch ((t.prev = t.next)) {
              case 0:
                return (
                  (n = "".concat(i, "/san/v1/logoff")),
                  (t.next = 3),
                  c.post(n, e, {})
                );
              case 3:
                return (a = t.sent), t.abrupt("return", a);
              case 5:
              case "end":
                return t.stop();
            }
        }, t);
      }),
    );
    return function (r) {
      return t.apply(this, arguments);
    };
  })());
